
abstract class Animal {
    public abstract void eat();
    public abstract void sleep();
}
class Dog extends Animal {
    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }
    @Override
    public void sleep() {
        System.out.println("狗趴着睡");
    }
}
class Cat extends Animal {
    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
    @Override
    public void sleep() {
        System.out.println("猫躺着睡");
    }
}
class Home {
    void inHomeEat(Animal animal) {
        System.out.print("在家: ");
        animal.eat();
    }
}
public class Test35 {
    public static void main(String[] args) {
        new Home().inHomeEat(new Dog());
        new Home().inHomeEat(new Cat());
    }
}